export const dragTable = (tableDataRef) => {
    let mouseFlag = false;
    let mouseStart = 0;
    let startX = 0;
    let tableBody = null;
    tableDataRef.value.$el.addEventListener('mousedown', (e) => {
      tableBody = tableDataRef.value.$refs.scrollBarRef.wrapRef;
      mouseFlag = true;
      mouseStart = e.clientX;
      startX = tableBody.scrollLeft;
      tableBody.style.cursor = 'grab';
    });
    tableDataRef.value.$el.addEventListener('mouseup', () => {
      mouseFlag = false;
      tableBody.style.cursor = 'auto';
    });
    tableDataRef.value.$el.addEventListener('mousemove', (e) => {
      if (mouseFlag) {
        let offset = e.clientX - mouseStart;
        tableBody.scrollLeft = startX - offset;
      }
    });
};